#ifndef HTTPUTILS_H
#define HTTPUTILS_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QtQml>
class HttpUtils : public QObject
{
    Q_OBJECT
    QML_ELEMENT
public:
    explicit HttpUtils(QObject *parent = nullptr);
    ~HttpUtils();


    Q_INVOKABLE void replyFinished(QNetworkReply* reply);
    Q_INVOKABLE void getApi(QString url ,QString paramName,QString param,int page, int pageSize);
    Q_INVOKABLE void postApi(QString url, QVariantMap body);
signals:
    void replySignal(QString reply);

private:
    QNetworkAccessManager *manager;
    QString BASE_URL="http://localhost:8080/";
};



#endif // HTTPUTILS_H
